﻿@inject IStringLocalizer<Transfers> Localizer

<Transfer TValue="string"
          Items="@Items1"
          LeftPanelText="@Localizer["LeftPannelText"]" RightPanelText="@Localizer["RightPannelText"]"
          LeftButtonText="@Localizer["LeftButtonText"]" RightButtonText="@Localizer["RightButtonText"]" />

@code {
    [NotNull]
    private IEnumerable<SelectedItem>? Items1 { get; set; }

    /// <summary>
    /// OnInitializedAsync 方法
    /// </summary>
    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        // 模拟异步加载数据源
        await Task.Delay(100);

        Items1 = GeneratorItems();
    }

    private IEnumerable<SelectedItem> GeneratorItems() =>Enumerable.Range(1, 15).Select(i => new SelectedItem()
    {
        Text = $"{Localizer["Data"]} {i:d2}",
        Value = i.ToString()
    });
}
